package com.biz.primus.model.order.vo.response;

import com.biz.primus.model.order.enums.*;
import com.biz.primus.model.order.vo.DeliveryVO;
import com.biz.primus.model.order.vo.OrderDeliveryInfoVO;
import com.biz.primus.model.order.vo.OrderProductVO;
import com.biz.primus.model.order.vo.OrderPromotionVO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
 * 订单返回模型
 *
 * @author Tiger Feng
 * @date 2017年11月09日
 */
@Data
@NoArgsConstructor
@ApiModel("订单返回模型")
public class OrderResponseVO implements Serializable {
    private static final long serialVersionUID = -3747551896527074240L;

    @ApiModelProperty("订单明细，商品")
    private List<OrderItemResponseVO> items;
    @ApiModelProperty("是否是秒杀订单,true:是,false:否")
    private Boolean seckillOrder;
    @ApiModelProperty("订单类型(FLASH:闪送、STORE:商城、SECKI:秒杀、SYNCH:同步)")
    private OrderType orderType;
    @ApiModelProperty("订单IP")
    private String orderIp;
    @ApiModelProperty("订单名称")
    private String orderName;
    @ApiModelProperty("订单编号")
    private String orderCode;
    @ApiModelProperty("门店编码(门店或省仓店)")
    private String depotCode;

    //@ApiModelProperty(value = "订单商品总金额,物流费用不计算在内")
    //private Integer orderAmount;
    @ApiModelProperty(value = "订单应付=商品总价-优惠券金额+运费")
    private Integer payableAmount;

    @ApiModelProperty(value = "商品总价，商品的最终价相加", hidden = true)
    @JsonIgnore
    private Integer productsAmount;
    @ApiModelProperty(value = "商品市场价总价", hidden = true)
    @JsonIgnore
    private Integer marketPriceTotal;
    @ApiModelProperty(value = "商品会员价总价", hidden = true)
    @JsonIgnore
    private Integer memberPriceTotal;
    @ApiModelProperty(value = "电子钱包总价", hidden = true)
    @JsonIgnore
    private Integer eWalletPriceTotal;
    @ApiModelProperty(value = "商品特价总价", hidden = true)
    @JsonIgnore
    private Integer spcialOfferPriceTotal;
    @ApiModelProperty(value = "促销抵扣总金额", hidden = true)
    @JsonIgnore
    private Integer discountPromotionMoneyTotal;
    @ApiModelProperty(value = "优惠券抵扣总金额", hidden = true)
    @JsonIgnore
    private Integer discountCouponMoneyTotal;

    @ApiModelProperty("订单包含的商品名称 以,,,做分隔")
    private String productNames;
    @ApiModelProperty("用户备注")
    private String userRemark;
    @ApiModelProperty(value = "商户自备注(一般用于客服)", hidden = true)
    @JsonIgnore
    private String selfRemark;
    //    @ApiModelProperty("物流费")
//    private Integer deliveryMoney;
    @ApiModelProperty("商品总数量")
    private Integer quantity;
    @ApiModelProperty("物流信息")
    private OrderDeliveryInfoVO delivery;

    //    @ApiModelProperty("物流状态<p>\n" +
//            "     FOR_OUTBOUND：待出库、\n" +
//            "     FOR_TAKE_THEIR：待自提、\n" +
//            "     DISTRIBUTING：配送中、\n" +
//            "     SIGNED：已签收、\n" +
//            "     PART_OF_SIGNED：部分签收、\n" +
//            "     REJECT：拒收\n" +
//            "     </p>")
//    private DeliveryState deliveryState;
    @ApiModelProperty("支付状态<p>\n" +
            "     WAIT_PAY：待支付、\n" +
            "     PAY_SUCCESS：支付成功、\n" +
            "     PAY_FAILURE：支付失败、\n" +
            "     PAY_ON_DELIVERY：货到付款</p>")
    private PaymentState paymentState;
    @ApiModelProperty("评价状态(WAITING_COMMENTS：待评价、ALREADY_COMMENTS：已评价)")
    private CommentState commentState;
    @ApiModelProperty("订单状态(WAIT_PAY:待付款," +
            "    WAIT_SEND:待发货," +
            "    WAIT_RECEIVE:待收货," +
            "    WAIT_EVALUATION:待评价," +
            "    ORDER_FINISHED:订单完成," +
            "    CANCELED:取消," +
            "    AFTER_SALE:售后中," +
            "    FINISHED_AFTER_SALE:售后完成)")
    private OrderState state;
    @ApiModelProperty(value = "特殊订单类型（voice_order：语音购物订单）", hidden = true)
    @JsonIgnore
    private SpecialOrderType specialOrderType;
    @ApiModelProperty(value = "删除标志", hidden = true)
    @JsonIgnore
    private Boolean isSignDeleted;
    @ApiModelProperty(value = "是否可退货", hidden = true)
    @JsonIgnore
    private Boolean returnable;
    @ApiModelProperty(value = "是否关联了退货单", hidden = true)
    @JsonIgnore
    private Boolean haveReturned;
    @ApiModelProperty(value = "退货单ID", hidden = true)
    @JsonIgnore
    private Long orderReturnId;
    @ApiModelProperty("是门店订单（true：门店订单、false：总店订单）")
    private Boolean isStoreOrder;

    @ApiModelProperty(value = "订单来源",
            notes = "\"android\":\"安卓\",\"wechat\":\"微商城\",\"ios\":\"ios\"")
    private OrderClient client;

    @ApiModelProperty(value = "当前订单汇总可支持的支付方式列表")
    private List<OrderPaymentWay> supportPaymentWays;

    /**
     * 订单请求模型中不接受"选择的促销"，在上层模型中直接同步
     */
    @ApiModelProperty(value = "促销(当前选择的促销)")
    private OrderPromotionVO promotion;
    @ApiModelProperty(value = "可选择促销")
    private List<OrderPromotionVO> optionalPromotions;

    @ApiModelProperty(value = "已选赠送商品列表")
    private List<OrderProductVO> selectedComplimentaryProducts;
    @ApiModelProperty(value = "可选择赠送商品列表")
    private List<OrderProductVO> optionalComplimentaryProducts;
    @ApiModelProperty(value = "赠送商品数量")
    private Integer complimentaryQuantity;
    @ApiModelProperty(value = "首单立减促销减免金额")
    private Integer firstOrderCutPromotionAmount;

    @ApiModelProperty(value = "可选择的配送列表")
    private List<DeliveryVO> optionalDeliveries;
    @ApiModelProperty("已选择的配送方式")
    private DeliveryVO selectedDelivery;

    @ApiModelProperty(value = "支付方式",
            notes = "\"alipay\":\"支付宝支付\",\"balance\":\"电子钱包支付\",\"wechatpay\":\"微信支付\",\"cod\":\"货到付款\",\"unionpay\":\"银联支付\"")
    private OrderPaymentWay paymentWay;
    @ApiModelProperty("推送中台时间")
    private Timestamp send2OMSTimestamp;
}
